<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">
    <ui:composition template="/layout/masterPageNotHeaderSearch.xhtml">
        <script type="text/javascript">
             $(document).ready(function (){
                 if($("#txtLoaiXeBan_Profile").val()!=="")
                    {
                        var dataarray=$("#txtLoaiXeBan_Profile").val().split(",");
                       // alert(dataarray);

                        $("#cboHangSX_Profile").val(dataarray);
                    }
             });
        </script>
         <f:metadata>

            <f:event type="preRenderView" listener="#{sys_NguoiDungController.onPageLoad_ThongTinCaNhan()}">

            </f:event>

        </f:metadata>
        <ui:define name="ui-header">
            <title>#{utilsController.getLanguages("ThongTinCaNhan")}</title>
        </ui:define>

        <ui:define name="ui-content">
            <h:form class="sky-form" id="sky-form">
                    <p:growl id="growl" showDetail="true" sticky="true" escape="false"  />  
                    <header>#{utilsController.getLanguages("ThongTinCaNhan").toUpperCase()}</header>
                    
                    <fieldset>                  
                        <section>
                            <label class="input">
                                <i class="icon-append fa fa-user"></i>
                                <p:inputText id="txtMa" placeholder="#{utilsController.getLanguages('UserName')}" value="#{sys_NguoiDungController.item.ma}" styleClass="rounded-custom-def"></p:inputText>
                                <p:message for="txtMa" />
                                <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_UserName")}</b>
                            </label>
                        </section>
                        <input type="hidden" value="#{sys_NguoiDungController.findObjUser().loaiXeBan}" id="txtLoaiXeBan_Profile" />
                        <c:if test="#{sys_NguoiDungController.findLoai()==0}">
                            <section id="sec">
                                
                                <c:set value="#{c_DangTinController.findAllHangXe1()}" var="hangxe" scope="session"></c:set>
                                <label class="label">#{utilsController.getLanguages("HangXe")}</label>
                                
                                <label class="select select-multiple">
                                    <select multiple="multiple" id="cboHangSX_Profile" style="height: 250px;">
                                        <c:forEach items="#{hangxe}" var="item">
                                            <option value="#{item.getID()}">#{item.getTenHang()}</option>
                                        </c:forEach>
                                    </select>
                                </label>
                            </section>
                        </c:if>
                        
                        <section>
                            <label class="input">
                                <i class="icon-append fa fa-envelope"></i>
                                <p:inputText placeholder="#{utilsController.getLanguages('Email')}" value="#{sys_NguoiDungController.item.email}" styleClass="rounded-custom-def"></p:inputText>
                                <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_Email")}</b>
                            </label>
                        </section>

                        <section>
                            <label class="input">
                                <i class="icon-append fa fa-lock"></i>
                                <p:password  placeholder="#{utilsController.getLanguages('MatKhau')}" value="#{sys_NguoiDungController.item.matKhau}" styleClass="rounded-custom-def"></p:password>

                                <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_MatKhau")}</b>
                            </label>
                        </section>

                        <section>
                            <label class="input">
                                <i class="icon-append fa fa-lock"></i>
                                <p:password  placeholder="#{utilsController.getLanguages('NhapLaiMatKhau')}" value="#{sys_NguoiDungController.nhapLaiMatKhau}" styleClass="rounded-custom-def"></p:password>

                                <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_NhapLaiMatKhau")}</b>
                            </label>
                        </section>
                    </fieldset>
                    
                   
                    
                    <fieldset>
                        <div class="row">
                            <section class="col col-6">
                                <label class="input">
                                    <p:inputText  placeholder="#{utilsController.getLanguages('Ho')}" value="#{sys_NguoiDungController.item.ho}" styleClass="rounded-custom-def"></p:inputText>

                                    <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_Ho")}</b>
                                </label>
                            </section>
                            <section class="col col-6">
                                <label class="input">
                                    <p:inputText  placeholder="#{utilsController.getLanguages('Ten')}" value="#{sys_NguoiDungController.item.ten}" styleClass="rounded-custom-def"></p:inputText>
                                    <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_Ten")}</b>
                                </label>
                            </section>
                        </div>

                        <section>
                            <label class="select">
                                <select name="gender"  id="cboGioiTinh" class="rounded-custom-def">
                                    <option value="M">#{utilsController.getLanguages("Nam")}</option>
                                    <option value="F">#{utilsController.getLanguages("Nu")}</option>
                                    <option value="O">#{utilsController.getLanguages("Khac")}</option>
                                </select>
                                <i></i>
                            </label>
                        </section>
                        <div class="row">
                            <section class="col col-6">
                                <label class="select">
                                    <c:set value="#{sI_TinhController.findAllQuocGia()}" var="vQuocGia" scope="session"></c:set>
                                    <select name="gender"  id="cboQuocGiaID" class="rounded-custom-def" onchange="cboQuocGiaID_Change_DangKy();">
                                        <c:forEach items="#{vQuocGia}" var="item">
                                            <option value="#{item.quocGiaID}" selected="#{sys_NguoiDungController.item.quocGiaID==item.quocGiaID?'selected':''}">#{item.tenQG}</option>
                                        </c:forEach>
                                    </select>
                                    <i></i>
                                </label>
                            </section>
                            <section class="col col-6">
                                 <label class="select">
                                     <p:outputPanel id="pnTinh">
                                         <c:set value="#{sI_TinhController.findAllTinh()}" var="vTinh" scope="session"></c:set>
                                        <select name="gender"  id="cboTinhID" class="rounded-custom-def">
                                            <c:forEach items="#{vTinh}" var="item">
                                                <option value="#{item.tinhID}" selected="#{sys_NguoiDungController.item.tinhID==item.tinhID?'selected':''}">#{item.tenTinh}</option>
                                            </c:forEach>
                                        </select>
                                          <i></i>
                                     </p:outputPanel>


                                </label>
                            </section>
                        </div>
                        <section>
                            <label class="input">
                                <i class="icon-append fa fa-envelope"></i>
                                <p:inputText placeholder="#{utilsController.getLanguages('DiaChi')}" value="#{sys_NguoiDungController.item.diaChi}" styleClass="rounded-custom-def"></p:inputText>
                                <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_DiaChi")}</b>
                            </label>
                        </section>
                        <div class="row">
                            <section class="col col-6">
                                <label class="input">
                                    <p:inputText  placeholder="#{utilsController.getLanguages('DienThoai')}" value="#{sys_NguoiDungController.item.dienThoai}" styleClass="rounded-custom-def"></p:inputText>

                                    <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_DienThoai")}</b>
                                </label>
                            </section>
                            <section class="col col-6">
                                <label class="input">
                                    <p:inputText  placeholder="#{utilsController.getLanguages('DienThoaiNha')}" value="#{sys_NguoiDungController.item.dienThoaiNha}" styleClass="rounded-custom-def"></p:inputText>

                                    <b class="tooltip tooltip-bottom-right">#{utilsController.getLanguages("rs_msg_DienThoaiNha")}</b>
                                </label>
                            </section>
                        </div>
                    </fieldset>
                    <footer>
                        <button class="btn-u rounded-custom-def" type="button" onclick="ThayDoiThongTinCaNhan_Click();">#{utilsController.getLanguages("Save")}</button>
                        <p:remoteCommand name="ThayDoiThongTinCaNhan"  actionListener="#{sys_NguoiDungController.ThayDoiThongTinCaNhan_Click}" update=":sky-form" oncomplete="updateSelectboxValue();" ></p:remoteCommand>
                        <p:remoteCommand name="cboQuocGiaID_Change" actionListener="#{sI_TinhController.cboQuocGiaID_Change}" update=":sky-form:pnTinh"></p:remoteCommand>
                    </footer>
            </h:form>
           
            <script type="text/javascript">
                $(document).ready(function() {
                   // alert();
                    var m=$("#txtLoaiXeBan_Profile").val().split(",");
                        $("#cboHangSX_Profile").val(m);
                    });
            </script>
        </ui:define>
    </ui:composition> 
</html>